package com.qf.air.config;

import com.qf.air.constants.RabbitMQConstant;
import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class RabbitMQConfig {

    @Bean
    public Exchange airExchange(){
        return ExchangeBuilder.topicExchange(RabbitMQConstant.AIR_EXCHANGE).build();
    }

    @Bean
    public Queue airQueue(){
        return QueueBuilder.durable(RabbitMQConstant.AIR_QUEUE).build();
    }

    @Bean
    public Binding airBinding(Queue airQueue,Exchange airExchange){    // air项目 的 air模块 的 CUD操作
        return BindingBuilder.bind(airQueue).to(airExchange).with("air.air.*").noargs();
    }


}
